home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Libraries / Graphic Elements 2 / GEDemo / Grabber.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-19  |  1.3 KB  |  65 lines  |  [TEXT/MPS ]

  1. /*
  2.     Grabber.h
  3.     
  4.     Special Graphic Element to manipulate other Graphic Elements
  5.     
  6.     Copyright 1993 by Al Evans. All rights reserved.
  7.     
  8.     11/29/93
  9.     
  10.     NOTICE:
  11.     
  12.     Because it acts as a "meta-element", this grabber utilizes knowledge of the
  13.     low-level implementation details of graphic elements and sensors. 
  14.     
  15. */
  16.  
  17.  
  18. #ifdef applec
  19. #ifndef __cplusplus
  20. #ifndef PRELOAD
  21. #pragma load "::ToolKit.precompile"
  22. #define PRELOAD
  23. #endif
  24. #endif
  25. #else
  26. #include <QDOffscreen.h>
  27. #endif
  28.  
  29. #include "GraphElements.h"
  30.  
  31. #define    grabberID 'GRBR'
  32. #define grabberPlane    32767
  33.  
  34. typedef struct {
  35.     GrafElement    baseGraphic;
  36.     short        slaveChgIntrvl;        //For restoration upon deselection
  37.     short        minPlane;            //Only grab elements with drawPlane >= minPlane
  38.     short        maxPlane;            //and <= maxPlane
  39. }    Grabber, *GrabberPtr;
  40.  
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif
  44.  
  45. /*
  46.     Create the grabber
  47. */
  48. GrafElPtr MakeGrabber(GEWorldPtr world);
  49.  
  50. //Activate or deactivate grabber
  51. void ActivateGrabber(GEWorldPtr world, Boolean activate);
  52.  
  53. //Grabber will pick up elements with planes >= minPlane and <= maxPlane
  54. void SetGrabberDepth(GEWorldPtr world, short newMinPlane, short newMaxPlane);
  55.  
  56. //Returns true if grabber is currently active
  57. Boolean GrabberActive(GEWorldPtr world);
  58.  
  59. //Returns pointer to element currently selected by grabber
  60. GrafElPtr  CurrentGrabberSelection(GEWorldPtr world);
  61.  
  62. #ifdef __cplusplus
  63. }
  64. #endif
  65.